package oop4;

/**
 * @author oldliu
 * @since 1.0
 */
//宠物
public class Pet {
    protected String name;
    private int love;//可爱值
    private int health;//健康值
    private String sex;
    public Pet(){
        System.out.println("pet的无参构造方法");
    }
    public Pet(String name, int love, int health, String sex) {
        this.name = name;
        this.love = love;
        this.health = health;
        this.sex = sex;
    }

    // String type;//类别
    public void print() {
        System.out.println("这个宠物叫" + name);
        System.out.println("这个宠物可爱程度" + love);
        System.out.println("健康值" + this.health);
        System.out.println("性别" + this.sex);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
    //    public void swim(){
//        System.out.println(name+"在游泳");
//    }
//    public void digg(){
//        System.out.println(name+"在挖洞");
//    }
//    public void fly(){
//        System.out.println(name+"在飞行");
//    }
//    public void speak(){
//        System.out.println(name+"在说话");
//    }

    @Override
    public String toString() {
        return "这是一只宠物，名字是"+this.name+",性别是"+sex+"，健康值是"+this.health+",可爱程度是"+this.love;
    }
}

